---
title: "AWS ECS"
sidebarTitle: "AWS ECS"
---

## Step 1: Login to AWS Console
- Open your web browser and navigate to the AWS Management Console.
- Log in using your AWS account credentials.

## Step 2: Navigate to ECS
- Click on the "Services" dropdown menu in the top left corner.
- Select "ECS" from the list of services.

## Step 3: Create 3 Task Definitions
- In the ECS dashboard, navigate to the "Task Definitions" section in the left sidebar.
    <img src="/images/ecs-task-def-create.png" alt="Task Definition" width="200" height="200" />
- Click on "Create new Task Definition".
    ![Create new task definition](/images/ecs-task-def-create-new.png)

    ### Task Definition 1 (Frontend - KeepUI):

    - Task Definition Family: keep-frontend
        ![Task Definition Family](/images/ecs-task-def-frontend1.png)
    - Configure your container definitions as below:
        - Infrastructure Requirements:
            - Launch Type: AWS Fargate
            - OS, Architecture, Network mode: Linux/X86_64
            - Task Size:
                - CPU: 1 vCPU
                - Memory: 2 GB
            - Task Role and Task Execution Role are optional if you plan on using secrets manager for example then create a task execution role to allow access to the secret manager you created.
        ![Infrastructure Requirements](/images/ecs-task-def-frontend2.png)
        - Container Details:
            - Name: keep-frontend
            - Image URI: us-central1-docker.pkg.dev/keephq/keep/keep-api:latest
            - Ports Mapping:
                - Container Port: 3000
                - Protocol: TCP
            ![Container Details](/images/ecs-task-def-frontend3.png)
            - Environment Variables: (This can be static or you can use parameter store or secrets manager)
                - DATABASE_CONNECTION_STRING
                - AUTH_TYPE
                - KEEP_JWT_SECRET
                - KEEP_DEFAULT_USERNAME
                - KEEP_DEFAULT_PASSWORD
                - SECRET_MANAGER_TYPE
                - SECRET_MANAGER_DIRECTORY
                - USE_NGROK
                - KEEP_API_URL
                (The below variable is optional if you don't want to use websocket)
                - PUSHER_DISABLED
                (The below variables are optional if you want to use websocket)
                - PUSHER_APP_ID
                - PUSHER_APP_KEY
                - PUSHER_APP_SECRET
                - PUSHER_HOST
                - PUSHER_PORT
            ![Environment Variables](/images/ecs-task-def-frontend4.png)
        - Review and create your task definition.

    ### Task Definition 2 (Backend - keepAPI):

    - Configure your container definitions as below:
        - Task Definition Family: keep-frontend
        ![Task Definition Family](/images/ecs-task-def-backend1.png)
        - Infrastructure Requirements:
            - Launch Type: AWS Fargate
            - OS, Architecture, Network mode: Linux/X86_64
            - Task Size:
                - CPU: 1 vCPU
                - Memory: 2 GB
            - Task Role and Task Execution Role are optional if you plan on using secrets manager for example then create a task execution role to allow access to the secret manager you created.
                ![Infrastructure Requirements](/images/ecs-task-def-backend2.png)
        - Container Details:
            - Name: keep-backend
            - Image URI: us-central1-docker.pkg.dev/keephq/keep/keep-api:latest
            - Ports Mapping:
                - Container Port: 8080
                - Protocol: TCP
                ![Container Details](/images/ecs-task-def-backend3.png)
            - Environment Variables: (This can be static or you can use parameter store or secrets manager)
                - DATABASE_CONNECTION_STRING
                - AUTH_TYPE
                - KEEP_JWT_SECRET
                - KEEP_DEFAULT_USERNAME
                - KEEP_DEFAULT_PASSWORD
                - SECRET_MANAGER_TYPE
                - SECRET_MANAGER_DIRECTORY
                - USE_NGROK
                - KEEP_API_URL
                (The below variable is optional if you don't want to use websocket)
                - PUSHER_DISABLED
                (The below variables are optional if you want to use websocket)
                - PUSHER_APP_ID
                - PUSHER_APP_KEY
                - PUSHER_APP_SECRET
                - PUSHER_HOST
                - PUSHER_PORT
                ![Environment Variables](/images/ecs-task-def-backend4.png)
        - Storage:
            - Volume Name: keep-efs
            - Configuration Type: Configure at task definition creation
            - Volume type: EFS
            - Storage configurations:
                - File system ID: Select an existing EFS filesystem or create a new one
                - Root Directory: /
                ![Volume Configuration](/images/ecs-task-def-backend5.png)
            - Container mount points:
                - Container: select the container you just created
                - Source volume: keep-efs
                - Container path: /app
                - Make sure that Readonly is not selected
                ![Container Mount](/images/ecs-task-def-backend6.png)
        - Review and create your task definition.

    ### Task Definition 3 (Websocket): (This step is optional if you want to have automatic refresh of the alerts feed)

    - Configure your container definitions as below:
        - Task Definition Family: keep-frontend
        ![Task Definition Family](/images/ecs-task-def-websocket1.png)
        - Infrastructure Requirements:
            - Launch Type: AWS Fargate
            - OS, Architecture, Network mode: Linux/X86_64
            - Task Size:
                - CPU: 0.25 vCPU
                - Memory: 1 GB
            - Task Role and Task Execution Role are optional if you plan on using secrets manager for example then create a task execution role to allow access to the secret manager you created.
            ![Infrastructure Requirements](/images/ecs-task-def-websocket2.png)
        - Container Details:
            - Name: keep-websocket
            - Image URI: quay.io/soketi/soketi:1.4-16-debian
            - Ports Mapping:
                - Container Port: 6001
                - Protocol: TCP
            ![Container Details](/images/ecs-task-def-websocket3.png)
            - Environment Variables: (This can be static or you can use parameter store or secrets manager)
                - SOKETI_DEBUG
                - SOKETI_DEFAULT_APP_ID
                - SOKETI_DEFAULT_APP_KEY
                - SOKETI_DEFAULT_APP_SECRET
                - SOKETI_USER_AUTHENTICATION_TIMEOUT
            ![Environment Variables](/images/ecs-task-def-websocket4.png)
    - Review and create your task definition.

## Step 4: Create Keep Service
- In the ECS dashboard, navigate to the "Clusters" section in the left sidebar.
- Select the cluster you want to deploy your service to.
- Click on the "Create" button next to "Services".
- Configure your service settings.
- Review and create your service.

## Step 5: Monitor Your Service
- Once your service is created, monitor its status in the ECS dashboard.
- You can view task status, service events, and other metrics to ensure your service is running correctly.
